package com.it.nongchanping.controller;

import com.it.nongchanping.entity.Company;
import com.it.nongchanping.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 企业信息控制器
 */
@Controller
@RequestMapping("/company")
public class CompanyController {
    
    @Autowired
    private CompanyService companyService;

    /**
     * 企业简介页 (关于我们)
     */
    @GetMapping("/about")
    public String about(Model model) {
        Company company = companyService.getCompanyInfo();
        model.addAttribute("company", company);
        return "company/about";
    }
    
    /**
     * 联系我们页
     */
    @GetMapping("/contact")
    public String contact(Model model) {
        Company company = companyService.getCompanyInfo();
        model.addAttribute("company", company);
        return "company/contact";
    }
} 